package com.imesne.office.excel.read;

import com.imesne.office.excel.model.ExcelCell;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;

/**
 * Created by liyd on 17/7/3.
 */
public interface ExcelCellReader {

    /**
     * 是否支持读取
     *
     * @param workbook   the workbook
     * @param sheet      the sheet
     * @param sheetIndex the sheet index
     * @param row        the row
     * @param rowIndex   the row index
     * @param cell       the cell
     * @param cellIndex  the cell index
     * @return boolean boolean
     */
    boolean isSupportRead(Workbook workbook, Sheet sheet, int sheetIndex, Row row, int rowIndex, Cell cell, int cellIndex);

    /**
     * 读取excel cell
     *
     * @param workbook   the workbook
     * @param sheet      the sheet
     * @param sheetIndex the sheet index
     * @param row        the row
     * @param rowIndex   the row index
     * @param cell       the cell
     * @param cellIndex  the cell index
     * @return excel cell
     */
    ExcelCell readExcelCell(Workbook workbook, Sheet sheet, int sheetIndex, Row row, int rowIndex, Cell cell, int cellIndex);
}
